String.prototype.Trim = function() { 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}  

String.prototype.LTrim = function() { 
	return this.replace(/(^\s*)/g, ""); 
} 

String.prototype.RTrim = function() { 
	return this.replace(/(\s*$)/g, ""); 
} 

function isIE() {
	return (navigator.appName == "Microsoft Internet Explorer"); 
}

function checkAll(checkAll, checkEach) {
	var checkStatus = $("[name='" + checkAll + "']").attr("checked")
	$("[name='" + checkEach + "']").each(
			function() {
				if (checkStatus) {
					$(this).attr("checked", "checked");
				} else {
					$(this).removeAttr("checked");
				}	
			}
	);	
}

function checkEach(checkAll, checkEach) {
	var checkStatus = true;
	$("[name='" + checkEach + "']").each(
			function() {
				if(!$(this).attr("checked")) {
					checkStatus = false;
				}
			}
	);	
	if (checkStatus) {
		$("[name='" + checkAll + "']").attr("checked", "checked");
	} else {
		$("[name='" + checkAll + "']").removeAttr("checked");
	}
}